home *** CD-ROM | disk | FTP | other *** search
- property ancestor, pPathFunctionData, pCurrentLoc, pStartLoc, pRefName
-
- on birth me, arguments
- set the ancestor of me to birth(script "Animator", arguments)
- set the pPathFunctionData of me to the pathData of arguments
- set pStartLoc to the location of arguments
- set pRefName to the RefName of arguments
- set pCurrentLoc to pStartLoc
- return me
- end
-
- on moveSprite me
- set theResult to chaoticLoc(me)
- set the pCurrentLoc of me to theResult
- set the loc of sprite the pChannel of me to the pCurrentLoc of me
- end
-
- on chaoticLoc me
- global gA, gY
- set OBJref to the pRefName of me
- set gA to 3.89999999999999991
- set gY to 0.19999999999999998
- if voidp(getaProp(getaProp(gObjects, pRefName), #animator)) then
- set lastPoint to getaProp(getaProp(gObjects, pRefName), #onloc)
- else
- set lastPoint to the pCurrentLoc of getaProp(getaProp(gObjects, pRefName), #animator)
- end if
- set graphData to getaProp(getaProp(gObjects, pRefName), #graphList)
- set lastY to getaProp(graphData, #lastY)
- set V to the locV of lastPoint
- set graphLeft to getaProp(graphData, #minHLoc)
- set graphRight to getaProp(graphData, #maxHLoc)
- set graphBottom to getaProp(graphData, #maxVLoc)
- set graphTop to getaProp(graphData, #minVLoc)
- set graphHeight to float(graphBottom - graphTop)
- set scaledGraphHeight to graphHeight * 0.75
- set m to 1
- set dw to getaProp(graphData, #frameHStep)
- set a to gA
- set H to the locH of lastPoint
- if H = graphLeft then
- erasegraphs()
- end if
- set H to the locH of lastPoint + dw
- if H >= graphRight then
- set H to graphLeft
- end if
- if V > 10000 then
- return point(H, 20000)
- end if
- if lastY = #NULL then
- set chaosSeedY to getaProp(graphData, #chaosSeedY)
- set yn to chaosSeedY
- else
- set yn to lastY
- end if
- repeat with i = 1 to m
- set yn to a * yn * (1 - yn)
- end repeat
- setaProp(graphData, #lastY, yn)
- set V to integer(graphTop + (0.5 * (graphHeight - scaledGraphHeight)) + ((1 - yn) * scaledGraphHeight))
- set aloc to point(H, V)
- return aloc
- end
-
- on erasegraphs
- set OBj to getaProp(gObjects, #barGraphBkgnd)
- set the loc of sprite getaProp(OBj, #SpriteNum) to getaProp(OBj, #offloc)
- updateStage()
- set the loc of sprite getaProp(OBj, #SpriteNum) to getaProp(OBj, #onloc)
- updateStage()
- end
-